{extend name="base:base" /}


{block name="body"}

<div class="container">


    <table class="table table-striped" >
        <?php
        foreach ($service_annotation as $k => $v) {
            ?>
            <thead>
                <tr>
                    <th><?php echo $k; ?></th>
                    <th><?php echo $v['title']; ?></th>
                    <th>URL</th>
                    <th nowrap>调用数</th>
                    <th nowrap>测试</th>
                </tr>
            </thead>
            <?php
            if (isset($v['child'])) {
                foreach ($v['child'] as $k2 => $v2) {

                    $url = 'api' . '/' . $dir . '.' . strtolower($k) . '/' . $k2;
                    ?>
                    <tr>
                        <td><?php echo $k2; ?></td>
                        <td><?php echo $v2['title']; ?></td>
                        <td><?php echo url($url); ?></td>
                        <td nowrap><?php
                            if (isset($statistics_lists[$url])) {
                                echo $statistics_lists[$url]['hits'];
                            } else {
                                //   echo 0;
                            }
                            ?></td>
                        <td nowrap><a class="btn btn-primary btn-xs" href="<?php echo url('views') ?>?dir=<?php echo $dir ?>&controller=<?php echo $k ?>&method=<?php echo $k2 ?>">测试</a></td>
                    </tr>
                    <?php
                }
            }
        }
        ?>
    </table>

</div>


{/block}